using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fated.Scenario.Events {
    public class RandomDestination : Event {
        public class WeightedDestination {
            public string label;
            public double probability;
        }
        public List<WeightedDestination> destinations = new List<WeightedDestination>();
        // The method alters the probabilities of the Weighted Destinations such that the sum is 1.0
        public void normalizeProbabilities() {
            double sum = 0;
            foreach (WeightedDestination w in destinations)
                sum += w.probability;
            for (int i = 0; i < destinations.Count(); i++)
                destinations[i].probability /= sum;
        }
    }
    public class Choice : Event {
        public class Option {
            public string label;
            public string text;
        }
        public string text;
        public List<Option> options = new List<Option>();
    }

    public class GotoDestination : Event {
        public string label = "";
    }

    public class ChangeScene : Event {
        public string destination = "";
    }

    public class Destination : Event {
        public string label = "";
    }

    public class IfGotoElseGoto : Event {
        public string condition = "";
        public string truecase;
        public string falsecase;
    }
}
